package com.spring02.demo.testenum;

public enum Season {
    SPRING("温暖", "春暖花开"),
    SUMMER("炎热", "夏日炎炎"),
    AUTUMN("凉爽", "秋高气爽"),
    WINTER("寒冷", "冬雪皑皑");
    private final String description;
    private final String feature;
    Season(String description, String feature) {
        this.description = description;
        this.feature = feature;
    }
    public String getDescription() {
        return description;
    }
    public String getFeature() {
        return feature;
    }
    // 示例方法，根据季节调整温度描述
    public String adjustTemperature(String temp) {
        if (this == WINTER) {
            return "寒冷的" + temp;
        } else if (this == SUMMER) {
            return "炎热的" + temp;
        }
        return temp; // 其他季节保持原样
    }
}

class Test{
    public static void main(String[] args) {
        for(int i=0;i<Season.values().length;i++) {
            System.out.println("索引"+Season.values()[i].ordinal()+"，值："+Season.values()[i]);
        }
    }
}